/*! Amaze UI Plugin ~ amazeui-datetimepicker-se */
@import "../node_modules/amazeui/less/variables";
@import "../node_modules/amazeui/less/mixins";

/*!
 * Amaze UI Datetimepicker SE
 * Modified version of Datetimepicker for Bootstrap 3 version : 4.17.37
 * @see https://github.com/Eonasdan/bootstrap-datetimepicker/
 */
@datetimepicker-timepicker-font-size: 1.2em;

@datetimepicker-border-radius: @global-radius;
@datetimepicker-btn-hover-bg: @gray-lighter;
@datetimepicker-disabled-color: @gray-light;
@datetimepicker-alternate-color: @gray-light;

@datetimepicker-secondary-border-color: @global-secondary;
@datetimepicker-secondary-border-color-rgba: @global-secondary;//rgba(0, 0, 0, 0.2);
@datetimepicker-primary-border-color: @global-secondary;
@datetimepicker-thead-height: 40px;
@datetimepicker-td-height: 34px;
@datetimepicker-active-bg: @gray-lighter;
@datetimepicker-active-color: @global-primary;

.bootstrap-datetimepicker-widget {
  width: 242px;
  padding: 0 2px 2px;
  background: #fff;
  z-index: 1100;

  &.timepicker-sbs {
    width: auto;
  }

  .list-unstyled {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .prev,
  th.picker-switch,
  .next {
    background: @global-secondary;
    color: #fff;
    height: 40px;
    line-height: 40px;

    &:hover {
      background: darken(@global-secondary, 7%);
    }
  }

  .next,
  .prev {
    width: 34px;
  }

  .dow {
    color: @global-primary;
  }

  &.dropdown-menu {
    display: block;
    margin-top: 7px;
    box-shadow: 0 0 2px #bbb;
    // border: 1px solid #dedede;

    &:before,
    &:after {
      content: '';
      display: inline-block;
      position: absolute;
    }

    &.bottom {
      &:before {
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid @datetimepicker-secondary-border-color;
        border-bottom-color: @datetimepicker-secondary-border-color-rgba;
        top: -7px;
        left: 7px;
      }

      /*&:after {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid @datetimepicker-primary-border-color;
        top: -6px;
        left: 8px;
      }*/

      &.right {
        &:before {
          left: auto;
          right: 10px;
        }
      }
    }

    &.top {
      &:before {
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-top: 7px solid @datetimepicker-secondary-border-color;
        border-top-color: @datetimepicker-secondary-border-color-rgba;
        bottom: -7px;
        left: 6px;
      }

      &:after {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid @datetimepicker-primary-border-color;
        bottom: -6px;
        left: 7px;
      }
    }

    &.pull-right {
      &:before {
        left: auto;
        right: 6px;
      }

      &:after {
        left: auto;
        right: 7px;
      }
    }
  }

  [data-action] {
    cursor: pointer;
  }

  .timepicker-hour,
  .timepicker-minute,
  .timepicker-second {
    width: 54px;
    font-weight: bold;
    font-size: @datetimepicker-timepicker-font-size;
    margin: 0;
  }

  button[data-action] {
    padding: 6px;
  }

  .picker-switch {
    text-align: center;

    td {
      padding: 0;
      margin: 0;
      height: auto;
      width: auto;
      line-height: inherit;

      a {
        cursor: pointer;
        display: block;

        &:hover {
          background: @datetimepicker-btn-hover-bg;
        }
      }

      span {
        line-height: 40px;
        height: 40px;
        width: 100%;
      }
    }
  }

  table {
    width: 238px;
    margin: 0;

    td,
    th {
      text-align: center;
    }

    th {
      height: @datetimepicker-thead-height;
      line-height: @datetimepicker-thead-height;
      font-weight: normal;

      &.disabled,
      &.disabled:hover {
        background: @global-secondary;
        color: lighten(@datetimepicker-disabled-color, 5%);
        cursor: not-allowed;
      }
    }

    thead tr:first-child th {
      cursor: pointer;

      &:hover {
        // background: @bs-datetimepicker-btn-hover-bg;
      }
    }

    td {
      height: 34px;
      line-height: 34px;
      // width: 54px;

      // 日期单元格
      &.day {
        width: 34px;
      }

      // 显示周数
      &.cw {
        font-size: .8em;
        height: 20px;
        line-height: 20px;
        color: @datetimepicker-alternate-color;
      }

      &.day:hover,
      &.hour:hover,
      &.minute:hover,
      &.second:hover {
        background: @datetimepicker-btn-hover-bg;
        cursor: pointer;
      }

      &.old,
      &.new {
        color: @datetimepicker-alternate-color;
      }

      // 当前日期样式
      &.today {
        position: relative;

        &:before {
          content: '';
          display: inline-block;
          border: solid transparent;
          border-width: 0 0 7px 7px;
          border-bottom-color: @datetimepicker-active-color;
          border-top-color: @datetimepicker-active-color;
          position: absolute;
          bottom: 4px;
          right: 4px;
        }
      }

      &.active,
      &.active:hover {
        background-color: @datetimepicker-active-bg;
        color: @datetimepicker-active-color;
      }

      &.active.today:before {
        // border-bottom-color: #fff;
      }

      &.disabled,
      &.disabled:hover {
        background: none;
        color: @datetimepicker-disabled-color;
        cursor: not-allowed;
      }

      // 月份年份选择
      .month,
      .year,
      .decade {
        float: left;
        width: 25%;
        height: 34px;
        line-height: 34px;
        margin: 2px 0;
        cursor: pointer;
        border-radius: @datetimepicker-border-radius;

        &:hover {
          background: @datetimepicker-btn-hover-bg;
        }

        &.active {
          background-color: @datetimepicker-active-bg;
          color: @datetimepicker-active-color;
        }

        &.old {
          color: @datetimepicker-alternate-color;
        }

        &.disabled,
        &.disabled:hover {
          background: none;
          color: @datetimepicker-disabled-color;
          cursor: not-allowed;
        }
      }

      // 年份期间
      .decade {
        width: 50%;
      }
    }
  }

  .datepicker-months,
  .datepicker-years {
    td {
      overflow: hidden;
    }
  }

  .collapse {
    display: none;
  }
  .collapse.in {
    display: block;
  }
}

.datepickerbutton {
  cursor: pointer;
}
